<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>01_初识jQuery</title>
    <script type="text/javascript">
        window.onload = function () {
            var btn1 = document.getElementById('btn1')
            btn1.onclick = function () {
                var username = document.getElementById('username').value
                alert(username)
            }
        }
    </script>
    <script src="js/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#btn2').click(function () {
                var username = $('#username').val()
                alert(username)
            })
        })
    </script>
</head>

<body>
    用户名:<input type="text" id="username">
    <button id="btn1">确定(原生版)</button>
    <button id="btn2">确定(jQuery版)</button>
</body>

</html>